-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Coins.AllGT() more robust and consistent #3820
Conversation
Please have a look at my implementation in #3678 // IsAllGT returns true if for every denom in coins, the denom is present at a
// greater amount in coinsB.
func (coins Coins) IsAllGT(coinsB Coins) bool {
if len(coins) == 0 {
return false
}
if len(coinsB) == 0 {
return true
}
if !coins.ContainsDenomsOf(coinsB) {
return false
}
for _, coinB := range coinsB {
amountA, amountB := coins.AmountOf(coinB.Denom), coinB.Amount
if !amountA.GT(amountB) {
return false
}
}
return true
} |
Codecov Report
@@ Coverage Diff @@
## develop #3820 +/- ##
===========================================
+ Coverage 60.93% 60.94% +0.01%
===========================================
Files 192 192
Lines 14328 14342 +14
===========================================
+ Hits 8731 8741 +10
- Misses 5028 5031 +3
- Partials 569 570 +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACKing Sunny's changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dig the DenomSubset approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several questions on implementation and comment/code mismatches.
Fails |
|
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: